Templating Annotation Resize Grips
The annotation resize grips (control-points, visible when AnnotationBase.IsSelected = true) can be retemplated by setting the AnnotationBase.ResizingGripsStyle property.
For example, the following code:
Templating Annotation Resize Grips |
Copy Code |
---|---|
<s:SciChartSurface > <s:SciChartSurface.Resources> <Style x:Key="GripStyle" TargetType="Thumb"> <Setter Property="Width" Value="7"/> <Setter Property="Height" Value="7"/> <Setter Property="Template"> <Setter.Value> <ControlTemplate> <Ellipse Fill="#55FFA500" Stroke="Orange" StrokeThickness="1" Width="7" Height="7"> <Ellipse.Effect> <DropShadowEffect BlurRadius="10" ShadowDepth="4" Direction="-45" Color="Black"/> </Ellipse.Effect> </Ellipse> </ControlTemplate> </Setter.Value> </Setter> </Style> </s:SciChartSurface.Resources> <s:SciChartSurface.XAxis> <s:NumericAxis AxisAlignment="Bottom" AxisTitle="Left XAxis" TickTextBrush="SteelBlue"/> </s:SciChartSurface.XAxis> <s:SciChartSurface.YAxis> <s:NumericAxis AxisAlignment="Left" AxisTitle="Top YAxis" TickTextBrush="Orange"/> </s:SciChartSurface.YAxis> <s:SciChartSurface.Annotations> <s:LineAnnotation X1="1" X2="5" Y1="1" Y2="4" StrokeThickness="2" Stroke="Orange" IsEditable="True" IsSelected="True" ResizingGripsStyle="{StaticResource GripStyle}"/> </s:SciChartSurface.Annotations> </s:SciChartSurface> |
Results in this: